<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!-- Begin Sidebar -->
<div id="sidebar" style="left: 0px; top: 0px;">
<table>
	<tr>
		<td><f:subview id="menu">
			<h:form id="menu">
				<h:dataTable value="#{categoryManagedBean.categories}" var="item">
					<h:column>
						<h:commandLink action="#{articleManagedBean.getSelectedCategoryArticle}">
							<h:outputText value="#{item.name}" />
							<f:param name="selecteditemId" value="#{item.id}" />
							<f:param name="selecteditemName" value="#{item.name}" />
						</h:commandLink>
					</h:column>
				</h:dataTable>
			</h:form>
		</f:subview></td>
	</tr>
	<tr>
		<td style="height: 120px;"></td>
	</tr>
	<tr>
		<td><f:subview id="signin">
			<h:form>
				<c:choose>
					<c:when test="${not empty sessionScope.member}">
						<table>
							<tr>
								<td><h:outputLabel value="Welcome  " /> <b>${sessionScope.member.name}</b></td>
							</tr>
							<tr>
								<td><h:commandLink action="#{memberManagedBean.logOut}">
									<h:outputText value="log out" />
								</h:commandLink></td>
							</tr>
						</table>
					</c:when>
					<c:otherwise>
						<!-- =============log on=============== -->
						<table>
							<tr>
								<td>
								<table>
									<tr>
										<td><h:outputLabel value="Email" /></td>
										<td><h:inputText value="#{memberManagedBean.email}" required="true" /></td>
									</tr>
									<tr>
										<td><h:outputLabel value="Pass" /></td>
										<td><h:inputSecret value="#{memberManagedBean.password2}" required="true" /></td>
									</tr>
									<tr>
										<td><h:commandButton value="Sign in" action="#{memberManagedBean.logOn}" /></td>
									</tr>
								</table>
								</td>
							</tr>
						</table>
					</c:otherwise>
				</c:choose>
				<!-- =============log on end=============== -->
			</h:form>
		</f:subview></td>
	</tr>
	<tr>
		<td><f:subview id="createaccount">
			<c:if test="${empty sessionScope.member}">
				<h:form>
					<tr>
						<td><br />
						<br />
						</td>
					</tr>
					<tr>
						<td><h:commandLink action="#{articleManagedBean.wantToBeMember}">
							<h:outputText value="Devenir membre" />
						</h:commandLink></td>
					</tr>
				</h:form>
			</c:if>
		</f:subview></td>
	</tr>
</table>
</div>
<!-- End Sidebar -->